import QtQuick 2.0
import "../../js/util.js" as Util
import "../../js/UI.js" as Style
import "../common"

Rectangle
{
    id: rect
    property alias m_eable: mouseBase.enabled
    property alias text: textID.text
    property alias textid : textID
    property alias text_color: textID.color
    property alias text_font: textID.font
    property var duration_time: 100

    signal mouseclickSignal;

    width: parent.width
    height: m_lineValue

    AText {
        id: textID
        anchors.verticalCenter: parent.verticalCenter
        anchors.left: parent.left
        anchors.leftMargin: Util.leftMarginScale * m_lineValue
        font.pointSize: Style.fontContentSize
    }
    MouseArea {
        id: mouseBase
        anchors.fill: parent
        onClicked: {
            mouseclickSignal();
        }
    }
    states: State {
        name: "pressed";
        when: mouseBase.pressed
        PropertyChanges { target: rect; color: Style.transparent_color;}
    }
    transitions: Transition {
            ColorAnimation { duration: duration_time }
    }
    color: "transparent"
}
